package cn.com.web;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liufl E-mail:Huberier@allpyra.com
 * @version 创建时间：2017年7月19日 下午2:51:51 类说明
 */
@RestController
@EnableAutoConfiguration
public class TestController {
	Logger log = LoggerFactory.getLogger(this.getClass());

    
	@RequestMapping("/test")
	public String hello() {
		return "Hello Spring Cloud!";
	}
	@RequestMapping("/testFeign/{name}")
	public String feignHello(@PathVariable String name,HttpServletRequest req) {
		String url=req.getScheme()+"://"+ req.getServerName()+":"+req.getServerPort()+"/"+req.getContextPath();
		return url+"_"+name;
	}
}
